from django import forms
from django.forms import ModelForm

from .models import Student

class Student1Form(forms.Form):
    name = forms.CharField(max_length=20)
    age = forms.IntegerField(max_value=20)

class StudentForm(ModelForm):
    class Meta:
        model = Student
        # fields = '__all__' # 包含所有字段
        fields = ['name', 'age']